<?php

class DashboardController extends Controller
{

	public function actionHome()
	{
		$itemList = Item::model()->findAll();
		
		$item_codes[] = '';
		$item_names[] = '';
		
		foreach ($itemList as $item)
		{
			$item_codes[$item->id] = $item->code;
			$item_names[$item->id] = $item->short_description;
		}
		
		$this->render('home', array('item_codes'=>json_encode($item_codes),'item_names'=>json_encode($item_names)));
	}

}